home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / tidict_1 / tidict~1.exe / Viewer / MainModule.bas < prev    next >
Encoding:
BASIC Source File  |  1998-06-20  |  1.3 KB  |  26 lines

  1. Attribute VB_Name = "MainModule"
  2. Option Explicit
  3.  
  4. 'this is controlling dictionary
  5. Public Dict As New TIDICTIONARYLib.Dictionary
  6.  
  7. Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
  8. Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
  9. Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long
  10.  
  11. Function GetPrivateIniString$(SectionName$, ItemName$, LPiniFile$, DefultValue$)
  12.   Dim dum As Integer
  13.   Dim sRBuff As String * 128, tmp As String
  14.   dum = GetPrivateProfileString(SectionName, ItemName, DefultValue, sRBuff, 128, LPiniFile)
  15.   tmp = Mid$(sRBuff, 1, InStr(sRBuff, Chr$(0)) - 1)
  16.   GetPrivateIniString = Trim$(tmp)
  17. End Function
  18.  
  19. Sub SetPrivateIniString(SectionName$, ItemName$, ByVal ItemData$, LPiniFile$)
  20.   Dim dum As Integer
  21.   Dim sRBuff As String, tmp As String
  22.   sRBuff = ItemData
  23.   dum = WritePrivateProfileString(SectionName, ItemName, sRBuff, LPiniFile)
  24. End Sub
  25.  
  26.